package privilege;

import entity.Luggage;
import factory.GarnishFactory;

import java.util.ArrayList;
import java.util.List;

/**
 * @author lishunlin110
 * @version 1.0
 * @description: 客户端类模拟
 * @date 2021/9/16 16:53
 */
public class Client {
    public static void main(String[] args) {
        Luggage luggage1 = new Luggage(12,17,18,19,"f");
        Luggage luggage2 = new Luggage(15,17,18,30,"f");
        Luggage luggage3 = new Luggage(16,17,18,32,"f");
        Luggage luggage4 = new Luggage(16,17,18,40,"f");
        List<Luggage> luggageList = new ArrayList<>();
        luggageList.add(luggage1);
        luggageList.add(luggage2);
        luggageList.add(luggage3);
        luggageList.add(luggage4);

//        Privilege area = new DomesticArea(luggageList);
//        Privilege p = new BusinessClass(area);
//        p = new PlatinumCard(p);
        Privilege area = new DomesticArea(luggageList);
        Privilege p = GarnishFactory.createGarnish("PlatinumCard",area);
        p = GarnishFactory.createGarnish("BusinessClass",p);
        luggageList = p.removeFreeLuggage();
        System.out.println(luggageList.toString());
    }
}
